<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <!-- 移动端设置不缩放 -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Resource</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
    <link rel="stylesheet" th:href="@{/css/common.css}">
</head>
<body>
    <!-- navbar -->
    <nav th:replace="_fragment::navbar(4)"></nav>

    <div>
        <div class="container">
            <div class="row m-container">
                <div class="col-sm-10 col-sm-offset-1">
                    <div id="resourceListContent">
                        <table th:fragment="resourceList" class="table" style="font-size: 15px;">
                            <h1 th:text="${root.getRelativePath()}"></h1>
                            <tr th:if="${root.getParent() != null}">
                                <td><a onclick="reDispatcher(this)" th:data-relative_path="${root.getParent().getRelativePath()}">../</a></td>
                                <td><span>-</span></td>
                                <td><span>-</span></td>
                                <td><span>-</span></td>
                            </tr>
                            <tr th:each="path: ${root.list()}">
                                <td><a th:text="${path.getName() + (path.isDirectory() ? '/' : '')}" onclick="reDispatcher(this)" th:data-relative_path="${path.getRelativePath()}"></a></td>
                                <td><span th:text="${path.isDirectory() ? '-' : path.getSize()}"></span></td>
                                <td><span th:text="${path.isDirectory() ? '-' : #dates.format(path.lastModified(), 'yyyy-MM-dd HH:mm:ss')}"></span></td>
                                <td><a class="btn btn-default" onclick="copyToClipboard(window.location.origin + window.location.pathname + $(this).data('uri'))" th:data-uri="${path.getRelativePath()}">复制链接</a></td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- footer -->
    <footer th:replace="_fragment::footer"></footer>

    <script src="https://cdn.staticfile.org/jquery/3.2.0/jquery.min.js"></script>
<!--    <script src="https://cdn.bootcss.com/jquery.fileDownload/1.4.2/jquery.fileDownload.js"></script>-->
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" ></script>
    <script src="https://eqcn.ajz.miesnfu.com/wp-content/plugins/wp-3d-pony/live2dw/lib/L2Dwidget.min.js"></script>
    <script src="https://unpkg.com/coco-message/coco-message.min.js"></script>
    <script th:src="@{/js/common.js}"></script>
    <script th:src="@{/js/resource.js}"></script>
</body>
</html>